import request from "@/utils/request";

export function listSysJob(data) {
    return request({
        url: '/monitor/sys_job/list',
        method: 'get',
        params: data
    })
}

export function changeSysJobStatus(data) {
    return request({
        url: '/monitor/sys_job/changeStatus',
        method: 'put',
        data: data
    })
}

export function addSysJob(data) {
    return request({
        url: '/monitor/sys_job/insert',
        method: 'post',
        data: data
    })
}

export function updateSysJob(data) {
    return request({
        url: '/monitor/sys_job/update',
        method: 'put',
        data: data
    })
}

export function getSysJob(jobId) {
    return request({
        url: '/monitor/sys_job/' + jobId,
        method: 'get'
    })
}

export function deleteSysJob(jobIds) {
    return request({
        url: '/monitor/sys_job/delete/' + jobIds,
        method: 'delete'
    })
}

export function runJob(jobId, jobGroup) {
    const data = {
        jobId,
        jobGroup
    };
    return request({
        url: '/monitor/sys_job/run',
        method: 'put',
        data: data
    })
}
